Imports MyFramework

Public Class SendEmailGeneralEnquiry
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents lblMessage As System.Web.UI.WebControls.Label
    Protected WithEvents txtCompanyName As System.Web.UI.WebControls.TextBox
    Protected WithEvents Requiredfieldvalidator7 As System.Web.UI.WebControls.RequiredFieldValidator
    Protected WithEvents cboTitle As System.Web.UI.WebControls.DropDownList
    Protected WithEvents txtFamilyName As System.Web.UI.WebControls.TextBox
    Protected WithEvents Requiredfieldvalidator8 As System.Web.UI.WebControls.RequiredFieldValidator
    Protected WithEvents txtGivenName As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtStreetAddress As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtCity As System.Web.UI.WebControls.TextBox
    Protected WithEvents RequiredFieldValidator3 As System.Web.UI.WebControls.RequiredFieldValidator
    Protected WithEvents txtState As System.Web.UI.WebControls.TextBox
    Protected WithEvents txtPostalCode As System.Web.UI.WebControls.TextBox
    Protected WithEvents Requiredfieldvalidator9 As System.Web.UI.WebControls.RequiredFieldValidator
    Protected WithEvents ddlCountry As System.Web.UI.WebControls.DropDownList
    Protected WithEvents Requiredfieldvalidator6 As System.Web.UI.WebControls.RequiredFieldValidator
    Protected WithEvents txtPhoneNumber As System.Web.UI.WebControls.TextBox
    Protected WithEvents Requiredfieldvalidator1 As System.Web.UI.WebControls.RequiredFieldValidator
    Protected WithEvents btnSend As System.Web.UI.WebControls.Button
    Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm
    Protected WithEvents isClosed As System.Web.UI.HtmlControls.HtmlInputHidden

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    ReadOnly Property Enquiry() As String
        Get
            Try

                Return Server.UrlDecode(Request.Item("enquiry").ToString())
            Catch ex As Exception
            End Try
            Return ""
        End Get
    End Property

    ReadOnly Property Email() As String
        Get
            Try
                Return Server.UrlDecode(Request.Item("email").ToString())
            Catch ex As Exception
            End Try
            Return ""
        End Get
    End Property

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
    End Sub

    Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
        Try
            Dim sendGeneralEnquiryObj As SendGeneralEnquiry = New SendGeneralEnquiry
            'With sendGeneralEnquiryObj
            '    .GeneralEnquiry = Enquiry
            '    .CompanyName = txtCompanyName.Text.Trim
            '    .CustomerName = cboTitle.SelectedValue & Convert.ToString(IIf(txtGivenName.Text.Trim = "", "", String.Format(" {0}", txtGivenName.Text.Trim))) & Convert.ToString(IIf(txtFamilyName.Text.Trim = "", "", " " & txtFamilyName.Text.Trim))
            '    .CustomerEmail = Email
            '    .Address = String.Format("{0} <br> {1}, {2} <br> {3}", txtStreetAddress.Text, txtCity.Text.Trim, txtPostalCode.Text.Trim, ddlCountry.SelectedItem.Text)
            '    .PhoneNumber = txtPhoneNumber.Text.Trim
            'End With

            sendGeneralEnquiryObj.Send(Email)

        Catch ex As Exception
            Logger.Error("Failed to send SendShoppingListEmail", ex)
        End Try
        Page.RegisterStartupScript("windowClose", "<script language='javascript'>windowClose();</script>")
    End Sub
End Class
